local skel = fk.CreateSkill{
  name = "est__bishan",
}
--local U = require "packages/utility/utility"
Fk:loadTranslationTable{
  ["est__bishan"] = "笔山",
  [":est__bishan"] = "准备阶段，你可以选择任意名攻击范围内的其他角色，本回合你使用牌不能指定这些角色为目标。"..
  "然后你摸X张牌且本回合你手牌上限+X（X为你选择的角色数）。",
  ["#est__bishan-choose"] = "笔山：你可以选择任意名攻击范围内的其他角色，本回合不能对其使用牌",
  ["@@est__bishan-turn"] = "笔山",
}
---@type TrigSkelSpec<PhaseFunc>
local bishan = {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(skel.name) and player == target and player.phase == Player.Start and table.find(player.room:getOtherPlayers(player), function (p)
      return player:inMyAttackRange(p)
    end)
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local targets = table.filter(room:getOtherPlayers(player), function (p)
      return player:inMyAttackRange(p)
    end)
    local tos = room:askToChoosePlayers(player, {
      targets = targets,
      min_num = 1,
      max_num = 999,
      skill_name = skel.name,
      prompt = "#est__bishan-choose"
    })
    if #tos > 0 then
      event:setCostData(self, { to = tos })
      return true
    end
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local tos = event:getCostData(self).to
    room:setPlayerMark(player, "@@est__bishan-turn", table.map(tos, Util.IdMapper))
    room:addPlayerMark(player, MarkEnum.AddMaxCardsInTurn, #tos)
    player:drawCards(#tos, skel.name)
  end
}
---@type ProhibitSpec
local bishan_prohibit = {
  is_prohibited = function (self, from, to, card)
    return from:hasSkill(skel.name, true) and table.contains(from:getTableMark("@@est__bishan-turn"), to.id)
  end
}
skel:addEffect(fk.EventPhaseStart, bishan)
skel:addEffect("prohibit", bishan_prohibit)
return skel